package com.hjy.controller;

import com.hjy.annotation.RequestBody;
import com.hjy.annotation.RequestMapping;
import com.hjy.annotation.ResponseBody;
import com.hjy.pojo.User;

import java.util.ArrayList;

@RequestMapping("/hello")
public class HelloController {

    @ResponseBody
    @RequestMapping("/hello1")
    public Object hello1() {
        ArrayList<String> list = new ArrayList<>();
        list.add("hello");
        list.add("world");
        list.add("嘻嘻");
        return list;
    }

    @RequestMapping("/hello2")
    public String hello2(Integer h,String hello) {
        System.out.println("h = " + h);
        System.out.println("hello = " + hello);
        return "/hello.jsp";
    }

    @RequestMapping("/hello3")
    @ResponseBody
    public User hello3(@RequestBody User user,String hello) {
        System.out.println("user = " + user);
        return user;
    }
}
